'use strict';

exports.__esModule = true;
exports.isFSA = isFSA;
exports.isError = isError;

var _lodash = require('lodash.isplainobject');

var _lodash2 = _interopRequireDefault(_lodash);

var _lodash3 = require('lodash.isstring');

var _lodash4 = _interopRequireDefault(_lodash3);

var _lodash5 = require('lodash.issymbol');

var _lodash6 = _interopRequireDefault(_lodash5);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function isFSA(action) {
  return (0, _lodash2.default)(action) && ((0, _lodash4.default)(action.type) || (0, _lodash6.default)(action.type)) && Object.keys(action).every(isValidKey);
}

function isError(action) {
  return action.error === true;
}

function isValidKey(key) {
  return ['type', 'payload', 'error', 'meta'].indexOf(key) > -1;
}